-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concrete Values #996
base: main
Are you sure you want to change the base?
Concrete Values #996
Conversation
d45ea39
to
a81c8ca
Compare
ef428e7
to
10726db
Compare
src/core/localize.rkt
Outdated
[(? literal?) 0] | ||
[(? variable?) 0] | ||
[(approx aprx-spec impl) exact] ;; TODO not sure what to do here. | ||
[`(if ,c ,ift ,iff) 0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't true error also possible here? Like, shouldn't it be the same as the true error in ift
and iff
?
src/core/localize.rkt
Outdated
(match (vector-ref nodes root) | ||
[(? literal?) 0] | ||
[(? variable?) 0] | ||
[(approx aprx-spec impl) exact] ;; TODO not sure what to do here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can also have true error? The exact value is the exact value of aprx-spec
, the computed value is the value of impl
, they can differ.
src/core/localize.rkt
Outdated
(define modifed-vars (append all-vars `(__exact))) | ||
(define true-error-expr (list `(- ,spec __exact))) | ||
(define diffMachine | ||
(rival-compile true-error-expr modifed-vars (list flonum-discretization))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is UI-only maybe it's fine but this way of doing it is slow, because you're compiling a separate machine for every single subexpression and every single input. It would be more efficient to do this in two passes: first compute the exact value for each subexpression for each input; then compile a second machine with one input and output per subexpression and feed in each input + each subexpression's exact value for that input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i'm a little confused on this. Do you mean something like?
(define exact-var-name '__exact)
(define extended
(for/list ([ctx (in-list ctx-list)])
(context-extend ctx exact-var-name (context-repr ctx))))
(define compare-specs
(for/list ([spec (in-list spec-list)])
`(- ,spec ,exact-var-name)))
(define compare-fn (eval-progs-real compare-specs extended))
79d683a
to
7d38bd3
Compare
22f20fd
to
f8f66c5
Compare
2fabe97
to
ffb5013
Compare
This PR surfaces the "true error" of an expression for the local error tree in Odyessy.
Before merging:
value->json
?